// Author: combacsa@kaist.ac.kr
// http://www.jungol.co.kr/prog/Hanal/hanalView.php?qs_code=2600
// Very easy?

//#define COMPILE_P2600
#ifdef COMPILE_P2600

#include <fstream>

using namespace std;

int main() {
	int n, m, answer = 0;

	ifstream in("input.txt");
	in >> n;
	for (int i = 0; i < n; i++) {
		in >> m;
		if (m < 10) {
		} else if (m <= 30) {
			answer += 500;
		} else {
			int overhead = (m - 30) % 10;
			m = 500 + ((m - 30) / 10) * 300;
			if (overhead > 0) m += 300;
			if (m > 50000) m = 50000;
			answer += m;
		}
	}
	in.close();

	ofstream out("output.txt");
	out << answer << "\n";
	out.close();

	return 0;
}

#endif
